package com.tarena.day0924;

public class Point {
	int x;
	int y;

	public Point() {
	}

	public void addX(int dx) {
		x += dx;
	}

	public void addY(int dy) {
		y += dy;
	}

	public Point(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public Point(int x) {
		this.x = x;
		this.y = x;
	}

	public String toString() {
		return x + "," + y;
	}

	public double moveTo(int x, int y) {
		int dx = this.x - x;
		int dy = this.y - y;
		double distance = Math.sqrt(dx * dx + dy * dy);
		this.x = x;
		this.y = y;
		return distance;
	}

}
